package com.shj.service.impl;

import com.shj.dao.SysInstitutionMapper;
import com.shj.entity.SysInstitution;
import com.shj.service.SysInstitutionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author songhuajian
 * @Description: TODO
 * @date 2020/5/11 16:07
 **/
@Service("sysInstitutionService")
public class SysInstitutionServiceImpl implements SysInstitutionService {
    @Autowired
    private SysInstitutionMapper sysInstitutionMapper;


    @Override
    public List<SysInstitution> findAll() {
        return sysInstitutionMapper.findAll();
    }

    @Override
    public SysInstitution findByAreaCode(String areaCode) {
        return sysInstitutionMapper.selectByPrimaryKey(areaCode);
    }

    @Override
    public int add(SysInstitution sysInstitution) {
        return sysInstitutionMapper.insert(sysInstitution);
    }

    @Override
    public int edit(SysInstitution sysInstitution) {
        return sysInstitutionMapper.update(sysInstitution);
    }

    @Override
    public int delete(String areaCode) {
        return sysInstitutionMapper.delete(areaCode);
    }
}
